<?php

use think\facade\Route;
use app\backend\middleware\JwtAuthMiddleware;

Route::post('login', 'Auth/login');
Route::post('logout', 'Auth/logout');
Route::post('auth/refresh', 'Auth/refreshToken');

Route::group(function () {
    Route::get('manager/list', 'Manager/getList');
    Route::post('manager/save', 'Manager/save');
    Route::post('manager/delete', 'Manager/delete');
    Route::post('manager/profile', 'Manager/profile');
    Route::post('manager/resetpassword', 'Manager/resetPassword');

    Route::get('product/list', 'Product/getList');
    Route::post('product/save', 'Product/save');
    Route::post('product/delete', 'Product/delete');

    Route::get('category/list', 'Category/getList');
    Route::post('category/save', 'Category/save');
    Route::post('category/delete', 'Category/delete');

    Route::get('payment_setting/list', 'PaymentSetting/getList');
    Route::post('payment_setting/save', 'PaymentSetting/save');
    Route::post('payment_setting/delete', 'PaymentSetting/delete');

    Route::get('user/list', 'User/getList');
    Route::post('user/save', 'User/save');

    Route::get('order/list', 'Order/getList');
    Route::post('order/save', 'Order/save');

    Route::post('upload', 'Upload/index');
})->middleware([
    JwtAuthMiddleware::class,
]);
